package com.recive.tarms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recive.tarms.model.Flight;
import com.recive.tarms.service.FlightService;

@Controller
@RequestMapping(value = "/tarms/flight")
public class FlightController {
	@Autowired
	private FlightService oFlightService;

	@ResponseBody
	@RequestMapping(value = "/add", produces = { "application/json;charset=UTF-8" })
	public int addUser(Flight oFlight) {
		return oFlightService.addFlight(oFlight);
	}

	@ResponseBody
	@RequestMapping(value = "/all", produces = { "application/json;charset=UTF-8" })
	public Object findAllUser() {
		return oFlightService.findAllFlight();
	}

}
